package de.baumann.browser.present

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.IJoinNodeView
import de.baumann.browser.model.NodeModel

class JoinNodePresenter : BasePresenter<IJoinNodeView>() {
    fun joinNode(nodeId: String) {
        NodeModel().joinNode(nodeId)
                .subscribe(object : OdinObserver<Any>(view) {
                    override fun onSuccess(data: Any?) {
                        if (view != null) {
                            view.joinNodeSuccess()
                        }
                    }
                })
    }

}